/**
 * Created By xuanhei on 2021/05/06
 */
import { APP_CONFIG } from '@config/index';
import { request, response } from './config/index';
import axios from 'axios';
// import store from "@/store";
// 创建axios实例
const service = axios.create({
  baseURL: APP_CONFIG.API_HOST, // 注入接口地址
  timeout: 30000 // 请求超时时间
});

// 添加request拦截器 (请求拦截器)
service.interceptors.request.use(request.config, request.error);

service.interceptors.response.use(response.response, response.error);

export default service;
